package com.corpgovernment.organization.mapper.budget;

import com.corpgovernment.organization.entity.db.budget.BudgetItemEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface BudgetItemMapper  {

    int insertBatchSelective(@Param("entities") List<BudgetItemEntity> entities);

    int updateBatchSelective(@Param("entities") List<BudgetItemEntity> entities);

    BudgetItemEntity selectByPrimaryKey(@Param("id") Long id);

    List<BudgetItemEntity> selectByBudgetId(@Param("budgetId") String budgetId);

    List<BudgetItemEntity> selectByBudgetIdAndType(@Param("budgetId") String budgetId, @Param("type") String type);

    List<BudgetItemEntity> selectByBudgetIds(@Param("budgetIds") List<String> budgetIds);

    void updateBudgetAmount(@Param("itemId") Long itemId,@Param("amount") BigDecimal amount);
}